Skip to content

Fix crash on account deletion via frontend - #455

Draft
MoralCode wants to merge 3 commits into
mainfrom
guptapratykshh/fix/delete-account-2672
Draft

Fix crash on account deletion via frontend#455
MoralCode wants to merge 3 commits into
mainfrom
guptapratykshh/fix/delete-account-2672

Conversation

@MoralCode

@MoralCode MoralCode commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Note

This PR was ported from augurlabs/augur#3509 filed by @guptapratykshh because the contribution was deemed to still be useful.

Description

This PR fixes a critical bug where users attempting to delete their accounts would encounter a 500 Internal Server Error. The root cause was that the user_delete() route handler was calling current_user.delete() without passing the required session parameter.

  • Fixed user_delete() function in augur/api/view/routes.py to pass db_session parameter to User.delete() method
  • Added try-except error handling to prevent unhandled exceptions
  • Added error logging for better debugging and issue tracking
  • Stored username before deletion to ensure success message displays correctly

This PR fixes #31

Notes for Reviewers
This still needs to be rebased onto modern collectoss/be checked for old naming, but i believe it should work (and if not its easy to test)

Signed commits

  • Yes, I signed my commits.

guptapratykshh and others added 3 commits March 16, 2026 15:37
- Pass required db_session parameter to current_user.delete()
- Add try-except block for proper exception handling
- Store username before deletion for accurate flash message
- Add error logging for debugging failed deletions

Signed-off-by: Pratyksh Gupta <pratykshgupta9999@gmail.com>
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
@MoralCode MoralCode added the waiting This change is waiting for some other changes to land first label Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting This change is waiting for some other changes to land first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete account fails

2 participants